import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main/index.vue'
import List from '../views/Main/hero/List.vue'
import Edit from '../views/Main/hero/Edit.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Main,
    children: [
      { path: '/hero/list', component: List },
      { path: '/hero/create', component: Edit },
      { path: '/hero/edit/:id', component: Edit, props: true }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
